package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Sales;
import com.itheima.reggie.entity.ShoppingCart;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface SalesMapper {

    void update(@Param("shoppingCart")ShoppingCart shoppingCart,@Param("sales")Sales sales);

    Sales find(@Param("shoppingCart")ShoppingCart shoppingCart,@Param("month")String month);

    void insert(@Param("shoppingCart")ShoppingCart shoppingCart,@Param("month")String month);

    @Select("select sale_count from sales where dish_id = #{dishId} and month = #{month}")
    Integer findDishMonthlySales(@Param("dishId") Long dishId,@Param("month")String month);

    @Select("select sale_count from sales where Setmeal_id = #{SetmealId} and month = #{month}")
    Integer findSetmealMonthlySales(@Param("SetmealId") Long dishId,@Param("month")String month);
}
